small cleanups
authorJonathan Lebon <jlebon@redhat.com>
Fri, 8 Apr 2016 16:18:17 +0000 (12:18 -0400)
committerColin Walters (automation) <walters+githubbot@verbum.org>
Fri, 8 Apr 2016 18:43:18 +0000 (18:43 +0000)
- Revert 'cannot' --> 'can not' (it's the exception!)
- Remove duplicate function
- Squelch compiler warnings

Closes: #248
Approved by: cgwalters

cfg.mk
docs/manual/related-projects.md
src/libostree/ostree-metalink.c
src/libostree/ostree-repo-file.c
src/libotutil/ot-variant-utils.c

diff --git a/cfg.mk b/cfg.mk
index 3806209e1fa5af456e030139cf67d764323e5d8e..d6a5039d26d36921da238748d5a5a8ef63aa3c3f 100644 (file)
--- a/cfg.mk
+++ b/cfg.mk
@@ -1,4 +1,4 @@
-export VC_LIST_EXCEPT_DEFAULT=^(git.mk|lib/.*|m4/.*|md5/.*|build-aux/.*|src/gettext\.h|.*ChangeLog|buildutil/.*)$$
+export VC_LIST_EXCEPT_DEFAULT=^(docs/.*|git.mk|lib/.*|m4/.*|md5/.*|build-aux/.*|src/gettext\.h|.*ChangeLog|buildutil/.*)$$
 
 local-checks-to-skip = \
     sc_const_long_option \
index 73972330a39b44ab66250c2b8cc8469499b8858f..896c7655db33cad9330576d0d91941b66004b69d 100644 (file)
@@ -63,7 +63,7 @@ awareness of BTRFS in dpkg/rpm itself) will be required.
 The OSTree author believes that having total freedom at the block
 storage layer is better for general purpose operating systems. For
 example, with OSTree, one is free to use BTRFS in any way you like -
-you can use a subvolume for `/home`, or you cannot.
+you may decide to use a subvolume for `/home`, or not.
 
 Furthermore, in its most basic incarnation, the rpm/dpkg + BTRFS
 doesn't solve the race conditions that happen when unpacking packages
index 5ca69e6980ff994ad5ab6e11d31f93cc285ce889..ad3a6a2a90c5912e2d24bf8732e935dd8361c41c 100644 (file)
@@ -491,7 +491,7 @@ try_metalink_targets (OstreeMetalinkRequest      *self,
                       GError                    **error)
 {
   gboolean ret = FALSE;
-  SoupURI *target_uri;
+  SoupURI *target_uri = NULL;
 
   if (!self->found_a_file_element)
     {
@@ -564,7 +564,7 @@ try_metalink_targets (OstreeMetalinkRequest      *self,
                    self->urls->len, self->last_metalink_error);
       goto out;
     }
-  
+
   ret = TRUE;
   if (out_target_uri)
     *out_target_uri = soup_uri_copy (target_uri);
index 49f7333d2b572f45c7293113f0d6b0e3eb70ce84..396820da9dc8014cf21bc8364bf5fc0acbe71768 100644 (file)
@@ -745,52 +745,6 @@ query_child_info_dir (OstreeRepo               *repo,
   return ret;
 }
 
-static gboolean
-bsearch_in_file_variant (GVariant  *variant,
-                         const char *name,
-                         int        *out_pos)
-{
-  gsize imax, imin;
-  gsize imid;
-  gsize n;
-
-  n = g_variant_n_children (variant);
-  if (n == 0)
-    return FALSE;
-
-  imax = n - 1;
-  imin = 0;
-  while (imax >= imin)
-    {
-      g_autoptr(GVariant) child = NULL;
-      const char *cur;
-      int cmp;
-
-      imid = (imin + imax) / 2;
-
-      child = g_variant_get_child_value (variant, imid);
-      g_variant_get_child (child, 0, "&s", &cur, NULL);      
-
-      cmp = strcmp (cur, name);
-      if (cmp < 0)
-        imin = imid + 1;
-      else if (cmp > 0)
-        {
-          if (imid == 0)
-            break;
-          imax = imid - 1;
-        }
-      else
-        {
-          *out_pos = imid;
-          return TRUE;
-        }
-    }
-
-  *out_pos = imid;
-  return FALSE;
-}
-
 int
 ostree_repo_file_tree_find_child  (OstreeRepoFile  *self,
                                     const char      *name,
@@ -806,7 +760,7 @@ ostree_repo_file_tree_find_child  (OstreeRepoFile  *self,
   dirs_variant = g_variant_get_child_value (self->tree_contents, 1);
 
   i = -1;
-  if (bsearch_in_file_variant (files_variant, name, &i))
+  if (ot_variant_bsearch_str (files_variant, name, &i))
     {
       *is_dir = FALSE;
       ret_container = files_variant;
@@ -814,7 +768,7 @@ ostree_repo_file_tree_find_child  (OstreeRepoFile  *self,
     }
   else
     {
-      if (bsearch_in_file_variant (dirs_variant, name, &i))
+      if (ot_variant_bsearch_str (dirs_variant, name, &i))
         {
           *is_dir = TRUE;
           ret_container = dirs_variant;
index 0305c34d979be05a5f7bd0d7a9623443250ebb1c..2dc07582c39065c4d29ab78058236199d592f55a 100644 (file)
@@ -319,7 +319,7 @@ ot_variant_bsearch_str (GVariant   *array,
                         int        *out_pos)
 {
   gsize imax, imin;
-  gsize imid;
+  gsize imid = -1;
   gsize n;
 
   n = g_variant_n_children (array);
@@ -337,7 +337,7 @@ ot_variant_bsearch_str (GVariant   *array,
       imid = (imin + imax) / 2;
 
       child = g_variant_get_child_value (array, imid);
-      g_variant_get_child (child, 0, "&s", &cur, NULL);      
+      g_variant_get_child (child, 0, "&s", &cur, NULL);
 
       cmp = strcmp (cur, str);
       if (cmp < 0)